package com.ta.gulimall.order.feign;

import com.ta.gulimall.common.utils.system.R;
import com.ta.gulimall.order.view.vo.LockStoreRespVo;
import com.ta.gulimall.order.view.vo.LockStoreVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient("gulimall-ware")
public interface WareFeignService {

    /**
     * 查询sku商品的库存
     * @param skuIds
     * @return
     */
    @PostMapping("/ware/waresku/listSkuWare")
    R listSkuWare(@RequestBody List<Long> skuIds);

    /**
     * 锁定库存
     * @param lockStoreVo
     * @return
     */
    @PostMapping("/ware/waresku/lockStore")
    R lockStore(@RequestBody LockStoreVo lockStoreVo);

    /**
     * 解锁库存
     * @param lockStoreRespVo
     * @return
     */
    @PostMapping("/ware/waresku/unlockStore")
    R unlockStore(@RequestBody LockStoreRespVo lockStoreRespVo);

}
